package cn.chengpengper.im.platform.common.model.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.Date;
/*@formatter:off*/

/**
 * ____________________
 * < 神兽护体，永无bug! >
 * --------------------
 *
 * @author huchengpeng
 * @version v1.0.0
 * @date 2024/11/23 15:15
 * @description 好友实体对象
 */

/*@formatter:on*/

@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@TableName("im_friend")
public class Friend extends Model<Friend> implements Serializable {
    private static final long serialVersionUID = -4692958083125280907L;

    @TableId(value = "id")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long id;

    @TableField("user_id")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long userId;

    @TableField("user_id")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long friendId;

    @TableField("friend_nick_name")
    private String friendNickName;

    @TableField("friend_head_image")
    private String friendHeadImage;

    @TableField("created_time")
    private Date createdTime;

    @Override
    protected Serializable pkVal() {
        return this.id;
    }
}
